﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<PaperSystem.Models.UpdateQuestion>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>试题库 - 修改题目</title>
    <link type="text/css" href="/Content/common.css" rel="Stylesheet" />
    <style type="text/css">
    .page_center{*position:relative;}/*解决IE6/7下滚动bug */
    .accordion{background:#9dbfe2;color:#111;border-bottom:10px solid #9dbfe2;}
    .accordion_header{height:30px;line-height:30px;padding-left:10px;}
    .accordion_content{margin:0 10px;padding:10px;background:#fff;_zoom:1;
        -moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;
    }
    .accordion_action{margin-top:10px;}
    .in_q{padding:6px 0;margin:2px 0;background:#fff;position:relative;z-index:10;
        border:1px solid #ddd;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;
    }
    .in_q_hover{border-color:#bbb;}
    .in_q_delete{display:none;}
    .in_q_remove_icon{display:none;width:20px;height:20px;overflow:hidden;position:absolute;z-index:11;top:2px;right:2px;cursor:pointer;background:url(/Content/images/icon.png) 0 0 no-repeat;text-indent:-9999px;}
    .in_q_hover .in_q_remove_icon{display:block;}
    .in_q .btn_gray{font-size:12px;}
    .q_row{*zoom:1;}
    .q_row:after{clear:both;content:"\20";display:block;height:0;}
    .q_left{float:left;width:96px;}
    .q_right{margin-left:100px;margin-bottom:10px;}
    .q_right textarea{width:100%;max-width:100%;padding:0;*width:98%;}
    .q_right input[type=text]{width:50%;}
    .q_right input.short{width:120px;}
    </style>
</head>
<body>

<div class="page_container">
	<div class="page_left">
		<div class="page_left_inner">
			<h1 class="left_logo"><span title="试题库系统" class="logo">试题库系统</span></h1>
			<%if (ViewData["userName"] != null){%>
			    <div class="left_message">欢迎您，<br/><%=Html.Encode(ViewData["userName"])%>老师<br /><a href="/Login/Logout/" class="logout">退出</a></div>
			<%} %>
			<ul class="left_nav">
				<li class="current"><a href="/Question/QuestionList">题库管理</a></li>
				<li><a href="/Paper/PaperList/">试卷管理</a></li>
				<li><a href="/Paper/PaperCorrectList1">改卷</a></li>
				<li><a href="/Statistics/PaperList">统计</a></li>
			</ul>
		</div>
	</div>
	<!-- end page_left -->
	<div class="page_center">
		<div class="page_center_inner">
			<div class="tab_container">
				<ul class="tab_nav">
					<li><a href="/Question/QuestionList/">查看题目</a></li>
					<li><a href="/Question/QuestionAdd/">添加题目</a></li>
					<li class="current">修改题目</li>
				</ul>
			</div>
			<!-- end tab_container -->
			<!-- content begin here -->
            <div class="accordion">
			<form action="/Question/QuestionUpdate/" method="post" id="question_form">
                <h2 class="accordion_header">题目基本信息</h2>
                <div class="accordion_content" id="content1">
                    <div style="margin-bottom:4px;">
                        <label>题型:</label><%=Html.Encode(Model.type)%><input type="hidden" name="question.type" id="type" value="<%=Model.type%>" />
                        &nbsp;&nbsp;
                        <label>语种:</label><%=Html.Encode(Model.course)%><input type="hidden" id="course" name="question.course" value="<%=Model.course%>" />
                        <input type="hidden" name="question.eid" value="<%=Model.eid%>" />
                        <input type="hidden" name="question.creator" value="<%=Model.creator%>" />
                        <input type="hidden" name="question.time" value="<%= Model.time %>" />
                        <input type="hidden" name="question.includeNum" id="includeNum" value="<%= Model.includeNum %>" />
                    </div>
                    <div>
                        <label>题目用途:</label><select name="question.TorE">
                            <% if (Model.TorE.ToString().Equals("考试")) { %>
                            <option value="考试" selected="selected">考试</option>
                            <option value="练习">练习</option>
                            <%} else { %>
                            <option value="考试">考试</option>
                            <option value="练习" selected="selected">练习</option>
                            <%} %>
                        </select>
                        <label>章节:</label><input type="text" name="question.chapter" style="width:80px;" value="<%= Model.chapter %>" class="data_confirm" data-confirm="reHTML length-20" />
                        <label>知识点:</label><input type="text" name="question.knowledge" value="<%= Model.knowledge %>" class="data_confirm" data-confirm="reHTML length-50" />
                    </div>
                </div>
                <h2 class="accordion_header" id="header2">题目内容</h2>
                <div class="accordion_content" id="content2">
                    <% if(Model.type.Equals("阅读理解")){%>
                    <div id="ex_question">
                        <label class="q_left">文章：</label>
                        <div class="q_right"><textarea name="question.content" rows="6" class="data_confirm" data-confirm="required"><%=Model.content %></textarea></div>
                    </div>
                    <!-- end of #ex_question -->
                    <div id="in_question">
                        <% int in_q_count = 0; %>
                        <% foreach (var in_q in Model.inq) { 
                            if(in_q.answerMode.Equals("选择题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="选择题" />
                                    <input type="hidden" class="optionNum" name="question.inq[<%=in_q_count %>].optionNum"  value="<%=in_q.optionNum %>" />
                                    <label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].Icontent" value="<%=in_q.Icontent %>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm short" data-confirm="required choice" /></div>
                                    <label class="q_left">答案数目:</label><div class="q_right"><label>单选题<input type="radio" name="question.inq[<%=in_q_count %>].isSingle" value="1" <%if(in_q.isSingle == 1){ %>checked="checked"<%}%>/></label>&nbsp;<label>多选题<input type="radio" name="question.inq[<%=in_q_count %>].isSingle" value="0" <%if(in_q.isSingle == 0){ %>checked="checked"<%}%>/></label></div>
                                    <%if (in_q.optionNum == 4) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%}else if (in_q.optionNum == 8) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_H">选项H:</label><div class="q_right choice_H"><input type="text" name="question.inq[<%=in_q_count %>].option8" value="<%=in_q.option8%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 2) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 6){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 5){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 3){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else{ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} %>
                                    <div class="btn_wrap"><%if (in_q.optionNum > 2){ %><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><%} %>
                                                          <%if (in_q.optionNum < 8){ %><a href="#" class="btn_gray btn_add" data-action="add" onclick="addChoice(this);">增加选项</a><%} %></div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <% in_q_count++; %>
                            <%} else if (in_q.answerMode.Equals("填空题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="填空题" />
                                    <label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].Icontent" value="<%=in_q.Icontent %>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <% in_q_count++; %>
                            <%} else if (in_q.answerMode.Equals("判断题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="判断题" />
                                    <label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].Icontent" value="<%=in_q.Icontent %>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <label class="q_left">参考答案：</label><div class="q_right"><label>正确<input type="radio" value="T" <%if(in_q.answer.Equals("T")){ %>checked="checked"<%} %> name="question.inq[<%=in_q_count %>].answer" /></label>&nbsp;<label>错误<input type="radio" value="F" name="question.inq[<%=in_q_count %>].answer" <%if(in_q.answer.Equals("F")){ %>checked="checked"<%} %>/></label></div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <% in_q_count++; %>
                            <%} else if (in_q.answerMode.Equals("回答问题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="回答问题" />
                                    <label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].Icontent" value="<%=in_q.Icontent %>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm" data-confirm="required reHTML"  /></div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <% in_q_count++; %>
                            <%} %>
                        <%} %>
                    </div>
                    <!-- end of #in_question -->
                    <div class="accordion_action clearfix" id="action2">
                        <div class="left in_action">
                            <a href="#" class="icon_add btn_gray btn_space" data-add="choice">增加选择题</a>
                            <a href="#" class="icon_add btn_gray btn_space" data-add="fill">增加填空题</a>
                            <a href="#" class="icon_add btn_gray btn_space" data-add="judge">增加判断题</a>
                            <a href="#" class="icon_add btn_gray btn_space" data-add="qna">增加问答题</a>
                        </div>
                        <a href="#" class="btn_blue right" id="btn_submit">提交题目</a>
                    </div>
                    <%} else if (Model.type.Equals("完形填空")) { %>
                    <div id="ex_question">
                        <label class="q_left">文章：</label>
                        <div class="q_right"><textarea name="question.content" rows="6" class="data_confirm" data-confirm="required reHTML"><%=Model.content %></textarea></div>
                    </div>
                    <!-- end of #ex_question -->
                    <div id="in_question">
                        <% int in_q_count = 0; %>
                        <% foreach (var in_q in Model.inq) {
                            if (in_q.answerMode.Equals("选择题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="选择题" />
                                    <input type="hidden" class="optionNum" name="question.inq[<%=in_q_count %>].optionNum"  value="<%=in_q.optionNum %>" />
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm short" data-confirm="required choice" /></div>
                                    <%if (in_q.optionNum == 4) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%}else if (in_q.optionNum == 8) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_H">选项H:</label><div class="q_right choice_H"><input type="text" name="question.inq[<%=in_q_count %>].option8" value="<%=in_q.option8%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 2) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 6){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 5){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 3){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else{ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} %>
                                    <div class="btn_wrap"><%if (in_q.optionNum > 2){ %><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><%} %>
                                                          <%if (in_q.optionNum < 8){ %><a href="#" class="btn_gray btn_add" data-action="add" onclick="addChoice(this);">增加选项</a><%} %>
                                    </div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <%in_q_count++; %>
                            <%} else if (in_q.answerMode.Equals("填空题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="填空题" />
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <%in_q_count++; %>
                            <%} %>
                        <%} %>
                    </div>
                    <!-- end of #in_question -->
                    <div class="accordion_action clearfix" id="action2">
                        <div class="left in_action">
                            <a href="#" class="icon_add btn_gray btn_space" data-add="choice">增加选择题</a>
                            <a href="#" class="icon_add btn_gray btn_space" data-add="fill">增加填空题</a>
                        </div>
                        <a href="#" class="btn_blue right" id="btn_submit">提交题目</a>
                    </div>
                    <%} else if (Model.type.Equals("翻译")) { %>
                    <div id="ex_question">
                        <label class="q_left">原文：</label>
                        <div class="q_right"><textarea name="question.content" rows="6" class="data_confirm" data-confirm="required reHTML"><%=Model.content %></textarea></div>
                    </div>
                    <!-- end of #ex_question -->
                    <div id="in_question">
                        <% int in_q_count = 0; %>
                        <% foreach (var in_q in Model.inq) { %>
                        <div class="in_q">
                            <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                            <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                            <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                            <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                            <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="回答问题" />
                            <label class="q_left">参考答案：</label><div class="q_right"><textarea name="question.inq[<%=in_q_count %>].answer" rows="6" class="data_confirm" data-confirm="required reHTML"><%=in_q.answer %></textarea></div>
                        </div>
                        <%in_q_count++; %>
                        <%}%>
                    </div>
                    <!-- end of #in_question -->
                    <div class="accordion_action clearfix" id="action2">
                        <a href="#" class="btn_blue right" id="btn_submit">提交题目</a>
                    </div>
                    <%} else if (Model.type.Equals("作文")) { %>
                    <div id="ex_question">
                        <label class="q_left">作文要求：</label>
                        <div class="q_right"><textarea name="question.content" rows="6" class="data_confirm" data-confirm="required reHTML"><%=Model.content %></textarea></div>
                    </div>
                    <!-- end of #ex_question -->
                    <div id="in_question">
                        <% int in_q_count = 0; %>
                        <% foreach (var in_q in Model.inq) { %>
                        <div class="in_q">
                            <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                            <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                            <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                            <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                            <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="回答问题" />
                            <label class="q_left">参考答案：</label><div class="q_right"><textarea name="question.inq[<%=in_q_count %>].answer" rows="6" class="data_confirm" data-confirm="required reHTML"><%=in_q.answer %></textarea></div>
                        </div>
                        <%in_q_count++; %>
                        <%}%>
                    </div>
                    <!-- end of #in_question -->
                    <div class="accordion_action clearfix" id="action2">
                        <a href="#" class="btn_blue right" id="btn_submit">提交题目</a>
                    </div>
                    <%} else if (Model.type.Equals("综合选择")) { %>
                    <div id="ex_question">
                        <label class="q_left">题目：</label>
                        <div class="q_right"><textarea name="question.content" rows="6" class="data_confirm" data-confirm="required reHTML"><%=Model.content %></textarea></div>
                    </div>
                    <!-- end of #ex_question -->
                    <div id="in_question">
                        <% int in_q_count = 0; %>
                        <% foreach (var in_q in Model.inq) { %>
                        <div class="in_q">
                            <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                            <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                            <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                            <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                            <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="选择题" />
                            <input type="hidden" class="optionNum" name="question.inq[<%=in_q_count %>].optionNum"  value="<%=in_q.optionNum %>" />
                            <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm short" data-confirm="required choice" /></div>
                            <label class="q_left">答案数目:</label><div class="q_right"><label>单选题<input type="radio" name="question.inq[<%=in_q_count %>].isSingle" value="1" <%if(in_q.isSingle == 1){ %>checked="checked"<%} %> /></label>&nbsp;<label>多选题<input type="radio" name="question.inq[<%=in_q_count %>].isSingle" value="0" <%if(in_q.isSingle == 0){ %>checked="checked"<%} %> /></label></div>
                            <%if (in_q.optionNum == 4) { %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%}else if (in_q.optionNum == 8) { %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_H">选项H:</label><div class="q_right choice_H"><input type="text" name="question.inq[<%=in_q_count %>].option8" value="<%=in_q.option8%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%} else if(in_q.optionNum == 2) { %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%} else if(in_q.optionNum == 6){ %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%} else if(in_q.optionNum == 5){ %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%} else if(in_q.optionNum == 3){ %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%} else{ %>
                                <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                            <%} %>
                            <div class="btn_wrap"><%if (in_q.optionNum > 2){ %><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><%} %>
                                <%if (in_q.optionNum < 8){ %><a href="#" class="btn_gray btn_add" data-action="add" onclick="addChoice(this);">增加选项</a><%} %>
                            </div>
                        </div>
                        <%in_q_count++; %>
                        <%}%>
                    </div>
                    <!-- end of #in_question -->
                    <div class="accordion_action clearfix" id="action2">
                        <a href="#" class="btn_blue right" id="btn_submit">提交题目</a>
                    </div>
                    <%} else if (Model.type.Equals("词语搭配")) { %>
                    <div id="ex_question">
                        <label class="q_left">题干：</label>
                        <div class="q_right"><textarea name="question.content" rows="6" class="data_confirm" data-confirm="required reHTML"><%=Model.content %></textarea></div>
                    </div>
                    <!-- end of #ex_question -->
                    <div id="in_question">
                        <% int in_q_count = 0; %>
                        <% foreach (var in_q in Model.inq) {
                            if (in_q.answerMode.Equals("选择题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="选择题" />
                                    <input type="hidden" class="optionNum" name="question.inq[<%=in_q_count %>].optionNum"  value="<%=in_q.optionNum %>" />
                                    <label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].Icontent" value="<%=in_q.Icontent %>" class="data_confirm" data-confirm="require reHTMLd" /></div>
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm short" data-confirm="required choice" /></div>
                                    <label class="q_left">答案数目:</label><div class="q_right"><label>单选题<input type="radio" name="question.inq[<%=in_q_count %>].isSingle" value="1" <%if(in_q.isSingle == 1){ %>checked="checked"<%} %> /></label>&nbsp;<label>多选题<input type="radio" name="question.inq[<%=in_q_count %>].isSingle" value="0" <%if(in_q.isSingle == 0){ %>checked="checked"<%} %> /></label></div>
                                    <%if (in_q.optionNum == 4) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%}else if (in_q.optionNum == 8) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_H">选项H:</label><div class="q_right choice_H"><input type="text" name="question.inq[<%=in_q_count %>].option8" value="<%=in_q.option8%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 2) { %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 6){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 5){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else if(in_q.optionNum == 3){ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} else{ %>
                                        <label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[<%=in_q_count %>].option1" value="<%=in_q.option1%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[<%=in_q_count %>].option2" value="<%=in_q.option2%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[<%=in_q_count %>].option3" value="<%=in_q.option3%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[<%=in_q_count %>].option4" value="<%=in_q.option4%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_E">选项E:</label><div class="q_right choice_E"><input type="text" name="question.inq[<%=in_q_count %>].option5" value="<%=in_q.option5%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_F">选项F:</label><div class="q_right choice_F"><input type="text" name="question.inq[<%=in_q_count %>].option6" value="<%=in_q.option6%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                        <label class="q_left choice_G">选项G:</label><div class="q_right choice_G"><input type="text" name="question.inq[<%=in_q_count %>].option7" value="<%=in_q.option7%>" class="data_confirm" data-confirm="required reHTML" /></div>
                                    <%} %>
                                    <div class="btn_wrap"><%if (in_q.optionNum > 2){ %><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><%} %>
                                        <%if (in_q.optionNum < 8){ %><a href="#" class="btn_gray btn_add" data-action="add" onclick="addChoice(this);">增加选项</a><%} %>
                                    </div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <%in_q_count++; %>
                            <%} else if (in_q.answerMode.Equals("填空题")) {%>
                                <div class="in_q">
                                    <input type="hidden" class="isDelete" name="question.inq[<%=in_q_count %>].isDelete" value="false" />
                                    <input type="hidden" class="isNew" name="question.inq[<%=in_q_count %>].isNew" value="false" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].iid" value="<%=in_q.iid %>" />
                                    <input type="hidden" class="order" name="question.inq[<%=in_q_count %>].Iorder" value="<%=in_q.Iorder %>" />
                                    <input type="hidden" name="question.inq[<%=in_q_count %>].answerMode" value="填空题" />
                                    <label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].Icontent" value="<%=in_q.Icontent %>" class="data_confirm" data-confirm="required reHTML"/></div>
                                    <label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[<%=in_q_count %>].answer" value="<%=in_q.answer %>" class="data_confirm" data-confirm="required reHTML"/></div>
                                    <div class="in_q_remove_icon" title="删除该小题">X</div>
                                </div>
                                <%in_q_count++; %>
                            <%} %>
                        <%} %>
                    </div>
                    <!-- end of #in_question -->
                    <div class="accordion_action clearfix" id="action2">
                        <div class="left in_action">
                            <a href="#" class="icon_add btn_gray btn_space" data-add="choice">增加选择题</a>
                            <a href="#" class="icon_add btn_gray btn_space" data-add="fill">增加填空题</a>
                        </div>
                        <a href="#" class="btn_blue right" id="btn_submit">提交题目</a>
                    </div>
                    <%} %>
                </div>
            </form>
            </div>	
			<!-- content end here -->
		</div>
	</div>
	<!-- end page_center -->
</div>
<!-- end page_container -->

<script type="text/javascript" src="/Scripts/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="/Scripts/common.js"></script>
<script type="text/javascript">
    var all_question_template =
    {
        //阅读理解（可以增加小题）
        '阅读理解':
        {
            'main_question': '<label class="q_left">文章：</label><div class="q_right"><textarea name="content" rows="6"></textarea></div>',
            'choice': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="选择题" />'
                        + '<input type="hidden" class="optionNum" name="question.inq[_order_].optionNum" value="4" />'
                        + '<label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[_order_].Icontent" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm short" data-confirm="required choice" /></div>'
                        + '<label class="q_left">答案数目:</label><div class="q_right"><label>单选题<input type="radio" name="question.inq[_order_].isSingle" value="1" checked="checked" /></label>&nbsp;<label>多选题<input type="radio" name="question.inq[_order_].isSingle" value="0" /></label></div>'
                        + '<label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[_order_].option1" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[_order_].option2" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[_order_].option3" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[_order_].option4" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="btn_wrap"><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><a href="#" class="btn_gray btn_add" data-action="add" onclick="addChoice(this);">增加选项</a></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'fill': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="填空题" />'
                        + '<label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[_order_].Icontent" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm" data-confirm=required reHTML"/></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'judge': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="判断题" />'
                        + '<label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[_order_].Icontent" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><label>正确<input type="radio" value="T" checked="checked" name="question.inq[_order_].answer" /></label>&nbsp;<label>错误<input type="radio" value="F" name="question.inq[_order_].answer" /></label></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'qna': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="回答问题" />'
                        + '<label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[_order_].Icontent" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'in_action': '<div class="left in_action"><a href="#" class="icon_add btn_gray btn_space" data-add="choice">增加选择题</a>'
                        + '<a href="#" class="icon_add btn_gray btn_space" data-add="fill">增加填空题</a>'
                        + '<a href="#" class="icon_add btn_gray btn_space" data-add="judge">增加判断题</a>'
                        + '<a href="#" class="icon_add btn_gray btn_space" data-add="qna">增加问答题</a></div>'
        },
        //完形填空（可以增加小题）
        '完形填空':
        {
            'main_question': '<label class="q_left">文章：</label><div class="q_right"><textarea name="content" rows="6" class="data_confirm" data-confirm="required reHTML"></textarea></div>',
            'choice': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="选择题" />'
                        + '<input type="hidden" class="optionNum" name="question.inq[_order_].optionNum" value="4" />'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm short" data-confirm="required choice" /></div>'
                        + '<label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[_order_].option1" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[_order_].option2" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[_order_].option3" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[_order_].option4" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="btn_wrap"><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><a href="#" class="btn_gray btn_add" onclick="addChoice(this);">增加选项</a></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'fill': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="填空题" />'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'in_action': '<div class="left in_action"><a href="#" class="icon_add btn_gray btn_space" data-add="choice">增加选择题</a>'
                        + '<a href="#" class="icon_add btn_gray btn_space" data-add="fill">增加填空题</a></div>'
        },
        //翻译（固定一道小题）
        '翻译':
        {
            'main_question': '<label class="q_left">原文：</label><div class="q_right"><textarea name="content" rows="6" class="data_confirm" data-confirm="required"></textarea></div>',
            'qna': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="回答问题" />'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><textarea name="question.inq[_order_].answer" rows="6" class="data_confirm" data-confirm="required reHTML"></textarea></div>'
                        + '</div>',
            'pre_insert': 'qna'
        },
        //作文（固定一道小题）
        '作文':
        {
            'main_question': '<label class="q_left">作文要求：</label><div class="q_right"><textarea name="content" rows="6" class="data_confirm" data-confirm="required reHTML"></textarea></div>',
            'qna': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="回答问题" />'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><textarea name="question.inq[_order_].answer" rows="6" class="data_confirm" data-confirm="required reHTML"></textarea></div>'
                        + '</div>',
            'pre_insert': 'qna'
        },
        //综合选择（固定一道小题）
        '综合选择':
        {
            'main_question': '<label class="q_left">题目：</label><div class="q_right"><textarea name="content" rows="6"></textarea></div>',
            'choice': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="选择题" />'
                        + '<input type="hidden" class="optionNum" name="question.inq[_order_].optionNum" value="4" />'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer"  class="data_confirm short" data-confirm="required choice"/></div>'
                        + '<label class="q_left">答案数目:</label><div class="q_right"><label>单选题<input type="radio" name="question.inq[_order_].isSingle" value="1" checked="checked" /></label>&nbsp;<label>多选题<input type="radio" name="question.inq[_order_].isSingle" value="0" /></label></div>'
                        + '<label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[_order_].option1" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[_order_].option2" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[_order_].option3" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[_order_].option4" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="btn_wrap"><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><a href="#" class="btn_gray btn_add" onclick="addChoice(this);">增加选项</a></div>'
                        + '</div>',
            'pre_insert': 'choice'
        },
        //词语搭配（可以增加选择题、填空题）
        '词语搭配':
        {
            'main_question': '<label class="q_left">题干：</label><div class="q_right"><textarea name="content" rows="6" class="data_confirm" data-confirm="required reHTML"></textarea></div>',
            'choice': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="选择题" />'
                        + '<input type="hidden" class="optionNum" name="question.inq[_order_].optionNum" value="4" />'
                        + '<label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[_order_].Icontent" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm short" data-confirm="required choice" /></div>'
                        + '<label class="q_left">答案数目:</label><div class="q_right"><label>单选题<input type="radio" name="question.inq[_order_].isSingle" value="1" checked="checked" /></label>&nbsp;<label>多选题<input type="radio" name="question.inq[_order_].isSingle" value="0" /></label></div>'
                        + '<label class="q_left choice_A">选项A:</label><div class="q_right choice_A"><input type="text" name="question.inq[_order_].option1" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_B">选项B:</label><div class="q_right choice_B"><input type="text" name="question.inq[_order_].option2" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_C">选项C:</label><div class="q_right choice_C"><input type="text" name="question.inq[_order_].option3" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left choice_D">选项D:</label><div class="q_right choice_D"><input type="text" name="question.inq[_order_].option4" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="btn_wrap"><a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a><a href="#" class="btn_gray btn_add" onclick="addChoice(this);">增加选项</a></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'fill': '<div class="in_q">'
                        + '<input type="hidden" class="isDelete" name="question.inq[_order_].isDelete" value="false" />'
                        + '<input type="hidden" class="isNew" name="question.inq[_order_].isNew" value="true" />'
                        + '<input type="hidden" class="order" name="question.inq[_order_].Iorder" value="" />'
                        + '<input type="hidden" name="question.inq[_order_].answerMode" value="填空题" />'
                        + '<label class="q_left">题目：</label><div class="q_right"><input type="text" name="question.inq[_order_].Icontent" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<label class="q_left">参考答案：</label><div class="q_right"><input type="text" name="question.inq[_order_].answer" class="data_confirm" data-confirm="required reHTML" /></div>'
                        + '<div class="in_q_remove_icon" title="删除该小题">X</div>'
                        + '</div>',
            'in_action': '<div class="left in_action"><a href="#" class="icon_add btn_gray btn_space" data-add="choice">增加选择题</a>'
                        + '<a href="#" class="icon_add btn_gray btn_space" data-add="fill">增加填空题</a></div>'
        }
    };

    var in_question_num = $('#in_question').find('.in_q').length;

    //选择题增加选项
    function addChoice(button) {
        var btn_wrap = $(button).parent('.btn_wrap'),
            choice_wrap = btn_wrap.parent(),
            current_num = choice_wrap.find('.optionNum').val();
        var insert_char;
        (current_num <= 8) && (insert_char = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'][current_num]);

        //插入新选项，在这之前要看一下这是第几道小题
        var option_num = choice_wrap.find('.choice_A input:nth-child(1)').attr('name').replace(/(^.*\[)|(\].*$)/g, '');  //.charAt(13);
        btn_wrap.before('<label class="q_left choice_' + insert_char + '">选项' + insert_char + ':</label><div class="q_right choice_' + insert_char + '"><input type="text" name="question.inq[' + option_num + '].option' + (++current_num) + '" class="data_confirm" data-confirm="required reHTML" /></div>');
        //更新选项数目
        choice_wrap.find('.optionNum').val(current_num);
        //如果已经8个选项，干掉添加按钮
        (current_num >= 8) && btn_wrap.find('.btn_add').remove();
        //如果允许删除，加上删除按钮
        (current_num <= 3) && btn_wrap.prepend('<a href="#" class="btn_gray btn_remove btn_space" onclick="return removeChoice(this);">删除选项</a>');

        return false;
    }

    //选择题删除选项
    function removeChoice(button) {
        var btn_wrap = $(button).parent('.btn_wrap'),
            choice_wrap = btn_wrap.parent(),
            current_num = choice_wrap.find('.optionNum').val();
        var remove_char;
        (current_num <= 8) && (remove_char = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'][--current_num]);

        //删掉最后一个选项
        choice_wrap.find('.choice_' + remove_char).remove();
        //更新选项数目
        /*delete choice_wrap.attr('data-choicenum', current_num);*/
        choice_wrap.find('.optionNum').val(current_num);
        //如果少于2个选项，干掉删除按钮
        (current_num <= 2) && btn_wrap.find('.btn_remove').remove();
        //如果允许添加，加上添加按钮
        (current_num >= 7) && btn_wrap.append('<a href="#" class="btn_gray btn_add" onclick="return addChoice(this);">增加选项</a>');

        return false;
    }

    //将所有小题的顺序排好
    function order_in_question() {
        var all_in_question = $('#in_question').find('.in_q');
        var j_children, j_child;
        var order = 1;
        $.each(all_in_question, function(index, in_q) {
            j_children = $(in_q).find('*');
            //所有的表单元素都更新一下name属性
            $.each(j_children, function(child_index, child) {
                j_child = $(child);
                if (j_child.attr('name') != undefined) {
                    j_child.attr('name', j_child.attr('name').replace(/question.inq\[\d*\]/, 'question.inq[' + index + ']'));
                }
            });
            //更新题内顺序
            if (!$(in_q).hasClass('in_q_delete')) {
                $(in_q).find('.order').val(order++);
            }
        });
    }

    //提交
    function doSubmit() {
        //填写大题包括的小题数目
        $('#includeNum').val($('#in_question').find('.in_q').not('.in_q_delete').length);
        
        //提交之前验证所有填的信息
        if ($('.in_q').not('.in_q_delete').length == 0) {
            message('您未添加任何小题目,不能提交!','error',true,5000);
            return false;
        }

        //删除的小题不用再验证
        $('.in_q_delete').find('.data_confirm').removeClass('data_confirm');

        //排序
        order_in_question();
        
        if (isInputOK()) {
            //提交
            document.getElementById('question_form').submit();
        }
    }

    //鼠标移上小题时加class名
    $('#in_question').on('mouseenter', '.in_q', function() {
        $(this).addClass('in_q_hover');
    }).on('mouseleave', '.in_q', function() {
        $(this).removeClass('in_q_hover');
    });

    //点击"X"删除小题
    $('#in_question').on('click', '.in_q_remove_icon', function() {
        //如果是本次新增的题目，直接删除
        //如果是原有的题目，标记为isDelete
        var in_q = $(this).parent('.in_q'),
            isNew = in_q.find('.isNew').val();
        if (isNew == 'true') {
            in_q.remove();
            in_question_num--;
            order_in_question();
        } else {
            in_q.find('.isDelete').val(true);
            in_q.addClass('in_q_delete');
        }
    });

    //获取对应的模板
    var type_value = $('#type').val();
    var question_template = all_question_template[type_value];
    
    //注册添加小题的事件
    $('#action2').on('click', function(event) {
        var target = $(event.srcElement || event.target);
        var in_question = target.attr('data-add');
        if (in_question == undefined) return false;
        var in_q = $(question_template[in_question].replace(/_order_/g, in_question_num++));
        in_q.find('.order').val( in_question_num - $('.in_q_delete').length );//真正的题目数=题目数-被删除的题目数
        $('#in_question').append(in_q);
        return false;
    });
    
    //提交按钮
    $('#btn_submit').on('click', doSubmit);
    
</script>

</body>
</html>
